package be.sc.classicnetwork.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.ManyToMany;

import org.hibernate.annotations.Filter;
import org.hibernate.validator.Email;
import org.hibernate.validator.NotEmpty;

/**
 * Entity for Contact.
 */
@Entity
@Filter(name = "published")
public class Contact extends AbstractEntity {

    private static final long serialVersionUID = 8669379290083127202L;

    private boolean published = true;

    private String firstName;

    @NotEmpty
    private String lastName;

    @Email
    @NotEmpty
    private String email;

    @Lob
    private String address;

    private String phone;

    private String mobile;

    private String fax;

    private String company;

    private String webSite;

    @Lob
    private String comment;

    @ManyToMany
    private Set<Make> makes = new HashSet<Make>();

    @ManyToMany
    private Set<Site> sites = new HashSet<Site>();

    /**
     * addMake.
     */
    public void addMake(Make make) {
	this.makes.add(make);
    }

    /**
     * addSite.
     */
    public void addSite(Site site) {
	this.sites.add(site);
    }

    public String getEmail() {
	return email;
    }

    public void setEmail(String email) {
	this.email = email;
    }

    public String getComment() {
	return comment;
    }

    public void setComment(String comment) {
	this.comment = comment;
    }

    public Set<Make> getMakes() {
	return makes;
    }

    public void setMakes(Set<Make> makes) {
	this.makes = makes;
    }

    public Set<Site> getSites() {
	return sites;
    }

    public void setSites(Set<Site> sites) {
	this.sites = sites;
    }

    public String getAddress() {
	return address;
    }

    public void setAddress(String address) {
	this.address = address;
    }

    public String getFax() {
	return fax;
    }

    public void setFax(String fax) {
	this.fax = fax;
    }

    public String getPhone() {
	return phone;
    }

    public void setPhone(String phone) {
	this.phone = phone;
    }

    public String getCompany() {
	return company;
    }

    public void setCompany(String company) {
	this.company = company;
    }

    public String getWebSite() {
	return webSite;
    }

    public void setWebSite(String webSite) {
	this.webSite = webSite;
    }

    public String getMobile() {
	return mobile;
    }

    public void setMobile(String mobile) {
	this.mobile = mobile;
    }

    public boolean isPublished() {
	return published;
    }

    public void setPublished(boolean published) {
	this.published = published;
    }

    public String getFirstName() {
	return firstName;
    }

    public void setFirstName(String firstName) {
	this.firstName = firstName;
    }

    public String getLastName() {
	return lastName;
    }

    public void setLastName(String lastName) {
	this.lastName = lastName;
    }
}
